﻿@{
    Layout = "~/Views/Shared/_Index.cshtml";
 }
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="post-form">
                <div class="select-list">
                    <ul>
                        <li>
                        用户名：<input id="userName" name="UserName" type="text" />
                        </li>
                        <li>
                             <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                             <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.add()"><i class="fa fa-plus"></i> 新增</a>
            <a class="btn btn-primary single disabled" onclick="$.operate.edit()"><i class="fa fa-edit"></i> 修改</a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" ><i class="fa fa-remove"></i> 删除</a>
            <a class="btn btn-warning" onclick="$.table.exportExcel()"><i class="fa fa-download"></i> 导出</a>
       </div>
         <div class="col-sm-12 select-table table-striped">
            <table id="gridTable"></table>
        </div>
    </div>
</div>

<script type="text/javascript">
    $(function () {
    var options = {
        id: "gridTable",     //数据表格id
        url: "/TeUserManager/TeUser/GetPageListJson",    //分页查询数据地址
        createUrl: "/TeUserManager/TeUser/TeUserForm",            //新增数据视图页
        updateUrl: "/TeUserManager/TeUser/TeUserForm",            //修改数据视图页
        removeUrl: "/TeUserManager/TeUser/DeleteFormJson",            //删除数据地址（批量删除）
        modalName: "",
        sortName:'baseCreateTime',     //排序字段
        sortOrder:'desc',              //排序类型
        columns: [
            { checkbox: true, visible: true },
            { field: 'id', title: 'id', visible: false },
            { field: 'userName', title: '用户名' },
            { field: 'password', title: '密码' },
            { field: 'gender', title: '性别(0未知 1男 2女)' },
            { field: 'birthday', title: '出生日期' },
            { field: 'portrait', title: '头像' },
            { field: 'email', title: 'Email' },
            { field: 'mobile', title: '手机' },
            { field: 'qq', title: 'QQ' },
            { field: 'wechat', title: '微信' },
         ],
         onClickRow: function (row, element) {
             element[0].firstElementChild.firstElementChild.click();
         }
     };
     $.table.init(options);
 });


</script>
